#ifndef FDSST_TRACKER_HPP
#define FDSST_TRACKER_HPP

#include <opencv2/opencv.hpp>
#include "base_tracker.hpp"
#include "fdsst/fdssttracker.hpp"

class FdsstTracker : public BaseTracker
{
public:
    cv::Mat mOriginGrayImg;
    cv::Mat mGrayImg;

    FdsstTracker()
    {
        mTracker = FDSSTTracker(true, false, true, false);
    }

    ~FdsstTracker() {}

    virtual int init(cv::Mat &img, cv::Rect2d &rect)
    {
        cv::cvtColor(img, mOriginGrayImg, CV_BGR2GRAY);
        mTracker.init(rect, mOriginGrayImg);
        mOriginBgrImg = img.clone();
        mOriginRect2d = rect;
        return 0;
    }

    virtual bool update(cv::Mat &img, cv::Rect2d &rect)
    {
        cv::cvtColor(img, mGrayImg, CV_BGR2GRAY);
        rect = mTracker.update(mGrayImg);
        return true;
    }

private:
    FDSSTTracker mTracker;
};

#endif